This page last changed on Feb 20, 2008 by scytacki.

It is easiest to get started with the Vernier devices because their protocols and native librarires are freely distributable.

Check out projects

Check out these projects from subversion:

These all use https://svn.concord.org/svn/projects/trunk/common/java as their root:

data/data
core/framework
sensor/labpro-usb
sensor/sensor
sensor/sensor-native
sensor/sensor-vernier
core/swing
thirdparty/thirdparty-jars

Prebuilt Built Documentation

Each project (except for thirdparty-jars) has documentation located here: http://source.concord.org/maven2/site/maven2-svn/
If you append the path above you can find the documentation for the project. A good place to start is the sensor/sensor project: http://source.concord.org/maven2/site/maven2-svn/sensor/sensor/

If you look under the "Project Reports" link to left, you can find the javadocs.

Setup build system

Eclipse

We typically use eclipse to work with this code. So each project has eclipse .project and .classpath files in it which configure the project in eclipse. If you check out all the projects above into a eclipse workspace you should all the projects should be built automatically.

NetBeans

If you use netbeans, you should be able to check all the projects out, and connect then add dependencies on each other. You can know the dependency for each project by looking in the pom.xml which inside of the project. You can also look at the built documentation described above to find the dependencies for each project.

There are also a combination of maven2 and netbeans plugins which might make this process automatic. We have not experimented with this at all, so it might not be a good approach more info can be found here: http://mevenide.codehaus.org

Because we do not use NetBeans, if you find things we could change to make it easier to use our projects in NetBeans please let us know.

Maven2 command line building

We use maven2 to build the projects outside of eclipse. For example the projects above are built here: http://continuum.concord.org/continuum/servlet/continuum

If you want to use maven2 to build the project you should install the latest version of maven http://maven.apache.org
We do not have a single project that will automatically build the all the projects, so you will have to build each separately. This can be done by running

mvn install

In each project in the following order:

  • core/framework
  • core/swing
  • data/data
  • sensor/sensor - The sensor project will have a problem building because it needs the rxtxcomm jar. You can find this in thirdparty-jars project. If are running on unix based system you should be able to cd into thirdparty-jars/maven2 and run install.sh rxtx-comm. Otherwise take a look at the install.sh script and do the same thing manually.
  • sensor/labpro-usb
  • sensor/sensor-native
  • sensor/sensor-vernier

Run a test

In sensor-native/src/java there is a class:
org.concord.sensor.nativelib.TestNative

That will setup up the Sensor Device System to work with the Vernier GoLink interface. And setup a request to work with a temperature sensor. And then it starts the sensors and prints out a few values, and stops the sensor.

Running from Eclipse

In all the projects are loaded into eclipse, you can go to the menu "Run" -> "Open Run Dialog...". Under the Java Application item on the left there will be a TestGoLinkTemerature item. This can be run by clicking on Run button.

Running from the commandline with maven

In the sensor-native folder run:

mvn dependency:build-classpath

After downloading several plugins, it print out a classpath that includes most of the jars needed to run the test class. Calling this classpath "$mvn_classpath".
java -Djava.library.path=bin -cp $mvn_classpath:target/classes/ org.concord.sensor.nativelib.TestNative

The classes from all the projects need to be added to the classpath. And the RXTXcomm-2.1.7.jar

Document generated by Confluence on Jan 27, 2014 16:55